<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Box (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">math.Box</span>
        <span>Extends</span>
        <span class="fn-name">
          
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for representing a box. A box is specified as a top, right, bottom,
and left. A box is useful for representing margins and padding.


  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_math_box.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/math/box.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.math.Box</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.math.Box(<span><span class="arg">top</span>,&nbsp;<span class="arg">right</span>,&nbsp;<span class="arg">bottom</span>,&nbsp;<span class="arg">left</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">top</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Top.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">right</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Right.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">bottom</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Bottom.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">left</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Left.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Box.html">
              goog.math.Box
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.ceil"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">ceil<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Rounds the fields to the next larger integer values.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            This box with ceil'd fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line286">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.clone"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">clone<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Creates a copy of the box with the same dimensions.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            A clone of this Box.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line87">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.contains"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">contains<span class="args">(<span class="arg">other</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether the box contains a coordinate or another box.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">other</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Coordinate or a Box.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the box contains the coordinate or other box.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line111">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.expand"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">expand<span class="args">(<span class="arg">top</span>,&nbsp;<span class="arg">opt_right</span>,&nbsp;<span class="arg">opt_bottom</span>,&nbsp;<span class="arg">opt_left</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Expands box with the given margins.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">top</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">Top margin or box with all margins.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_right</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Right margin.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_bottom</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Bottom margin.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_left</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Left margin.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            A reference to this Box.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line125">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.expandToInclude"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">expandToInclude<span class="args">(<span class="arg">box</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Expand this box to include another box.
NOTE(user): This is used in code that needs to be very fast, please don't
add functionality to this function at the expense of speed (variable
arguments, accepting multiple argument types, etc).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">The box to include in this one.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line150">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.floor"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">floor<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Rounds the fields to the next smaller integer values.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            This box with floored fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line300">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.round"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">round<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Rounds the fields to nearest integer values.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            This box with rounded fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line314">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.scale"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">scale<span class="args">(<span class="arg">sx</span>,&nbsp;<span class="arg">opt_sy</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Scales this coordinate by the given scale factors. The x and y dimension
values are scaled by <code> sx</code> and <code> opt_sy</code> respectively.
If <code> opt_sy</code> is not given, then <code> sx</code> is used for both x and y.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">sx</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The scale factor to use for the x dimension.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_sy</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The scale factor to use for the y dimension.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            This box after scaling.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line362">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.toString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toString<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Returns a nice string representing the box.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            In the form (50t, 73r, 24b, 13l).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line98">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.prototype.translate"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">translate<span class="args">(<span class="arg">tx</span>,&nbsp;<span class="arg">opt_ty</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Translates this box by the given offsets. If a <code> goog.math.Coordinate</code>
is given, then the left and right values are translated by the coordinate's
x value and the top and bottom values are translated by the coordinate's y
value.  Otherwise, <code> tx</code> and <code> opt_ty</code> are used to translate the x
and y dimension values.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">tx</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">The value to translate the x
    dimension values by or the the coordinate to translate this box by.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_ty</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The value to translate y dimension values by.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            This box after translating.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line335">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Box.html">
              goog.math.Box
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.Box.prototype.bottom"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">bottom</span>
        : 
     </div>


     <div class="entryOverview">
       Bottom

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line53">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.Box.prototype.left"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">left</span>
        : 
     </div>


     <div class="entryOverview">
       Left

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line59">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.Box.prototype.right"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">right</span>
        : 
     </div>


     <div class="entryOverview">
       Right

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line47">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.Box.prototype.top"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">top</span>
        : 
     </div>


     <div class="entryOverview">
       Top

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line41">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.boundingBox"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">boundingBox<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
      </div>


     <div class="entryOverview">
       Creates a Box by bounding a collection of goog.math.Coordinate objects

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...goog.math.Coordinate</span>
        <div class="entryOverview">Coordinates to be included inside
    the box.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>&nbsp;
            A Box containing all the specified Coordinates.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line69">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.contains"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">contains<span class="args">(<span class="arg">box</span>,&nbsp;<span class="arg">other</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether a box contains a coordinate or another box.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">other</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Coordinate or a Box.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the box contains the coordinate or other box.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line183">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.distance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">distance<span class="args">(<span class="arg">box</span>,&nbsp;<span class="arg">coord</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the distance between a coordinate and the nearest corner/side of a
box. Returns zero if the coordinate is inside the box.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">coord</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The distance between <code> coord</code> and the nearest
    corner/side of <code> box</code>, or zero if <code> coord</code> is inside
    <code> box</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line247">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.equals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">equals<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Compares boxes for equality.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True iff the boxes are equal, or if both are null.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line164">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.intersects"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">intersects<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether two boxes intersect.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A second Box.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the boxes intersect.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line261">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.intersectsWithPadding"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">intersectsWithPadding<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>,&nbsp;<span class="arg">padding</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether two boxes would intersect with additional padding.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A second Box.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">padding</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The additional padding.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the boxes intersect.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line275">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.relativePositionX"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">relativePositionX<span class="args">(<span class="arg">box</span>,&nbsp;<span class="arg">coord</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the relative x position of a coordinate compared to a box.  Returns
zero if the coordinate is inside the box.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">coord</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The x position of <code> coord</code> relative to the nearest
    side of <code> box</code>, or zero if <code> coord</code> is inside <code> box</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line208">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Box.relativePositionY"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Box.</span><span class="entryName">relativePositionY<span class="args">(<span class="arg">box</span>,&nbsp;<span class="arg">coord</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the relative y position of a coordinate compared to a box.  Returns
zero if the coordinate is inside the box.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <span class="type"><a href="class_goog_math_Box.html">goog.math.Box</a></span>
        <div class="entryOverview">A Box.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">coord</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The y position of <code> coord</code> relative to the nearest
    side of <code> box</code>, or zero if <code> coord</code> is inside <code> box</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box.js.source.html#line227">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="math.Box"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
